<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
			var str1 = "hello world";
			var str2 = new String("hello world");
			
			//length属性,返回字符串长度
			console.log(str1.length);
			
			//大小写转换
			console.log(str1.toUpperCase());//大写
			console.log(str1.toLowerCase());//小写
			
			//获取指定字符
			console.log(str1.charAt(3));
			
			// 查询指定字符串出现的索引
			console.log(str1.indexOf("wor",1));
			console.log(str1.lastIndexOf("wor",1))
			
			//分割 得到的是数组
			var str3 = "how are you";
			var array = str3.split(" ");
			console.log(array);
			console.log(array[1]);
			console.log("2:3:4:5".split(":",3));
			
			// nan not a number 不是数字
			// 0,null ,"",undefined,NaN都可视为空值
			
			if(0){
				console.log("0");
			}
			
		</script>
	</body>
</html>
